// 引入vuerouter的相关包
import { createWebHashHistory, createRouter } from "vue-router";

// 引入要使用的相关vue组件文件
import Login from "../components/Login.vue";
import Main from "../views/Main.vue";

// 上班打卡
import Punchin from "../views/sys/Punchin.vue";
// 考勤信息
import Attendance from "../views/sys/Attendance.vue";
// 员工列表
import UserList from "../views/sys/UserList.vue";
// 添加员工
import Adduser from "../views/sys/Adduser.vue";
// 工作日志
import Log from "../views/sys/Log.vue";
// 部门目标
import Target from "../views/sys/Target.vue";
// 考核列表
import Assess from "../views/sys/Assess.vue";
// 添加考核
import Addassess from "../views/sys/Addassess.vue";
// 考题列表
import Exams from "../views/sys/Exams.vue";
// 参与考核
import Participate from "../views/sys/Participate.vue";
// 工资核算
import Acconunting from "../views/sys/Accounting.vue";
// 个人信息
import Userinfo from "../views/sys/Userinfo.vue";

// 创建实例化对象
const history = createWebHashHistory();
const router = createRouter({
  history,
  routes: [
    {
      name: "登录页",
      path: "/login",
      component: Login,
    },
    {
      name: "主体页",
      path: "/main",
      redirect: "/punchin",
      component: Main,
      children: [
        {
          name: "上班打卡",
          path: "/punchin",
          component: Punchin,
        },
        {
          name: "考勤信息",
          path: "/attendance",
          component: Attendance,
        },
        {
          name: "添加员工",
          path: "/adduser",
          component: Adduser,
        },
        {
          name: "工作日志",
          path: "/log",
          component: Log,
        },
        {
          name: "员工列表页",
          path: "/userlist",
          component: UserList,
        },
        {
          name: "部门目标",
          path: "/target",
          component: Target,
        },
        {
          name: "考核列表",
          path: "/assess",
          component: Assess,
        },
        {
          name: "添加考核",
          path: "/addassess",
          component: Addassess,
        },
        {
          name: "考题列表",
          path: "/exams",
          component: Exams,
        },
        {
          name: "参与考核",
          path: "/participate",
          component: Participate,
        },
        {
          name: "工资核算",
          path: "/acconunting",
          component: Acconunting,
        },
        {
          name: "个人信息",
          path: "/userinfo",
          component: Userinfo,
        },
      ],
    },
  ],
});

// 把router路径暴露出去
export default router;
